// <copyright file="ILevelGenerator.cs" company="TenneySoftware">
// Copyright (c) 2009 All Right Reserved
// </copyright>
// <author>Robert Tenney</author>
// <email>rob10e@yahoo.com</email>
// <date>April 2009</date>
// <summary>Interface for Level Generation functionality.</summary>

// License:

// Product: RPGRoguelikeEngine .Net
// Author: Robert N. Tenney
// Copyright: April 2009

// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation version 2
// of the License.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

// This license covers all source code, binaries, and other materials related to this project
// unless specifically stated otherwise.

using System;
using System.Drawing;
using TenneySoftware.Engine;

namespace TenneySoftware.LevelGenerator {
    /// <summary>
    /// Interface for Level Generation functionality.
    /// </summary>
    public interface ILevelGenerator {
        /// <summary>
        /// Gets the generated level array with the extended data.
        /// </summary>
        /// <value>
        /// The generated level array with the extended data.
        /// </value>
        Level Level {
            get;
        }
        
        /// <summary>
        /// Gets the name associated with this module.
        /// </summary>
        /// <value>
        /// The name associated with this module.
        /// </value>
        string ModuleName {
            get;
        }
        
        /// <summary>
        /// Gets the description associated with this module.
        /// </summary>
        /// <value>
        /// The description associated with this module.
        /// </value>
        string ModuleDescription {
            get;
        }
        
        /// <summary>
        /// Gets or sets the seed value to use for the generation of this level.
        /// </summary>
        /// <value>
        /// The seed value to use for the generation of this level.
        /// </value>
        int RandomSeed {
            get;
            set;
        }
        
        /// <summary>
        /// Gets the name of the predefined setting used.
        /// </summary>
        /// <value>
        /// The name of the predefined setting used.
        /// </value>
        string SettingsName {
            get;
        }
        
        /// <summary>
        /// Gets the generated level as an array of integers. Does not contain extended data.
        /// </summary>
        /// <returns>Array of integers of the generated level.</returns>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1814:PreferJaggedArraysOverMultidimensional", MessageId = "Return", Justification = "Multidimentional preferred.")]
        int[,] LevelArray();
        
        /// <summary>
        /// Generates the level.
        /// </summary>
        /// <returns>True if generated successfully, false otherwise.</returns>
        bool Generate();
                
        /// <summary>
        /// Sets the size of the level.
        /// </summary>
        /// <param name="size">The size to set the level to.</param>
        void SetSize(Size size);
        
        /// <summary>
        /// Uses one of the many predefined settings for the generator. See generator's API documentation or call the
        /// GetPredefinedInformation() method to discover predefines.
        /// </summary>
        /// <param name="predefined">Predefined value code to use.</param>
        void UsePredefinedSettings(int predefined);
        
        /// <summary>
        /// Passes parameters to unique properties within this generator through the ILevelSettings interface. See generator's
        /// API documentation or call the GetUniquePropertyInformation() method to discover properties.
        /// </summary>
        /// <param name="options">Jagged array of objects with the property code at the first position, and the value
        /// to pass in the second position.</param>
        void SetUniqueProperties(object[][] options);
        
        /// <summary>
        /// Passes parameters to unique methods within this generator through the ILevelSettings interface. See generator's
        /// API documentation or call the GetUniqueMethodInformation() method to discover properties.
        /// </summary>
        /// <param name="methodCalls">Jagged array of objects with the method code at the first position, and the arguments
        /// to pass in the remaining position.</param>
        void UseUniqueMethods(object[][] methodCalls);
        
        /// <summary>
        /// Retrieves a list of methods that are unique to the generator.
        /// </summary>
        /// <returns>An array of GeneratorData objects with information about the unique methods within the generator.</returns>
        GeneratorData[] GetUniqueMethodInformation();
        
        /// <summary>
        /// Retrieves a list of properties that are unique to the generator.
        /// </summary>
        /// <returns>An array of GeneratorData objects with information about the unique properties within the generator.</returns>
        GeneratorData[] GetUniquePropertyInformation();
        
        /// <summary>
        /// Retrieves a list of Predefined settings associated with the generator.
        /// </summary>
        /// <returns>An array of GeneratorData objects with information about the predefines within the generator.</returns>
        GeneratorData[] GetPredefinedInformation();
    }
}
